package com.example.controller;

import com.example.service.UserAreaGroupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/userAreaGroup")
public class UserAreaGroupController {

    @Autowired
    private UserAreaGroupService userAreaGroupService;

    /**
     * 为引导号加入对应的换书小组
     */
    @PostMapping("/add/selfGroup")
    public String addSelfGroup(String poiPath){
        return userAreaGroupService.addSelfGroup(poiPath);
    }

    /**
     * 为引导号加入所在街道换书小组
     */
    @PostMapping("/add/streetGroup")
    public String addStreetGroup(String poiPath){
        return userAreaGroupService.addStreetGroup(poiPath);
    }

    /**
     * 为引导号加入最近社区换书小组（书店开始，我是 自己手机号的加入附近社区）
     */
    @PostMapping("/add/communityGroup")
    public String addCommunityGroup(String poiPath,String areaPath){
        return userAreaGroupService.addCommunityGroup(poiPath,areaPath);
    }

    /**
     * 为引导号加入通用小组
     */
    @PostMapping("/add/commonGroup")
    public String addCommonGroup(String poiPath,String groupPath){
        return userAreaGroupService.addCommonGroup(poiPath,groupPath);
    }

    /**
     * 为引导号加入图书馆小组
     */
    @PostMapping("/add/libraryGroup")
    public String addLibraryGroup(String poiPath,String groupPath){
        return userAreaGroupService.addLibraryGroup(poiPath,groupPath);
    }

}
